package com.biogerm.ab;

import android.app.Activity;
import android.os.Bundle;

public class AutoBrightness extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        //TextView tv = new TextView(this);
        //tv.setText("gello");
        //int b = 100;
        
        try {
        	//int a = android.provider.Settings.System.getInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS);
        	//b = a;
			//tv.setText(Integer.toString(a));
			//tv.append(" " + Integer.toString(android.provider.Settings.System.getInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE)));
			//tv.append(" " + Integer.toString(android.provider.Settings.System.getString(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC)));
			//tv.append(" " + Integer.toString(android.provider.Settings.System.getString(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL)));
			android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE, 1);
			//tv.append(" " + Integer.toString(android.provider.Settings.System.getInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE)));
			//tv.append(" test ");
		} catch (Exception e) { //SettingNotFoundException
			// TODO Auto-generated catch block
			//tv.append(e.getMessage());
			//e.printStackTrace();
		}
		//setContentView(tv);
		//android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE, 1);
        //WindowManager.LayoutParams lp = getWindow().getAttributes();
        //lp.screenBrightness = b / 255.0f;
        //getWindow().setAttributes(lp);
        System.exit(0);
    }
}